package com.hup.restTimer.view.rest;

import com.hup.utils.swing.customView.ImageButton;
import com.hup.utils.swing.customView.ImageLabel;
import com.hup.utils.swing.ui.MyWindowsSliderUI;

import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JSlider;
import javax.swing.border.TitledBorder;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

/**
 * @author hugan
 * @date 2022/10/2
 */
public class RestWindowForm {
    public JPanel root;
    public JButton btnRestStart;
    public JButton btnRestStop;
    //
    public JPanel pImage;
    public ImageButton btnImageChange;
    public ImageButton btnImagePenetration;
    public JSlider slImageAlpha;

    public RestWindowForm() {
        $$$setupUI$$$();
        slImageAlpha.setUI(new MyWindowsSliderUI(slImageAlpha));
    }

    /**
     * Method generated by IntelliJ IDEA GUI Designer
     * >>> IMPORTANT!! <<<
     * DO NOT edit this method OR call it in your code!
     *
     * @noinspection ALL
     */
    private void $$$setupUI$$$() {
        root = new JPanel();
        root.setLayout(new GridBagLayout());
        root.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), null, TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null));
        btnRestStart = new JButton();
        btnRestStart.setText("开始休息");
        GridBagConstraints gbc;
        gbc = new GridBagConstraints();
        gbc.gridx = 1;
        gbc.gridy = 0;
        gbc.weightx = 1.0;
        gbc.weighty = 1.0;
        gbc.fill = GridBagConstraints.BOTH;
        gbc.insets = new Insets(3, 0, 3, 3);
        root.add(btnRestStart, gbc);
        btnRestStop = new JButton();
        btnRestStop.setText("停止休息");
        gbc = new GridBagConstraints();
        gbc.gridx = 2;
        gbc.gridy = 0;
        gbc.weightx = 1.0;
        gbc.weighty = 1.0;
        gbc.fill = GridBagConstraints.BOTH;
        gbc.insets = new Insets(3, 0, 3, 3);
        root.add(btnRestStop, gbc);
        final ImageLabel imageLabel1 = new ImageLabel();
        imageLabel1.setIcon(new ImageIcon(getClass().getResource("/img/app_tray.png")));
        imageLabel1.setUnitedIconHeight(2.0f);
        imageLabel1.setUnitedIconWidth(2.0f);
        gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 0;
        root.add(imageLabel1, gbc);
        pImage = new JPanel();
        pImage.setLayout(new GridBagLayout());
        gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 1;
        gbc.gridwidth = 3;
        gbc.fill = GridBagConstraints.BOTH;
        root.add(pImage, gbc);
        btnImageChange = new ImageButton();
        btnImageChange.setIcon(new ImageIcon(getClass().getResource("/img/icon_refresh.png")));
        btnImageChange.setPadding(2);
        btnImageChange.setUnitedIconHeight(1.0f);
        btnImageChange.setUnitedIconWidth(2.0f);
        gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.fill = GridBagConstraints.BOTH;
        pImage.add(btnImageChange, gbc);
        slImageAlpha = new JSlider();
        slImageAlpha.setMajorTickSpacing(50);
        slImageAlpha.setMaximum(255);
        slImageAlpha.setMinimum(5);
        gbc = new GridBagConstraints();
        gbc.gridx = 2;
        gbc.gridy = 0;
        gbc.weightx = 1.0;
        gbc.anchor = GridBagConstraints.WEST;
        gbc.fill = GridBagConstraints.HORIZONTAL;
        pImage.add(slImageAlpha, gbc);
        btnImagePenetration = new ImageButton();
        btnImagePenetration.setCheckbox(true);
        btnImagePenetration.setIcon(new ImageIcon(getClass().getResource("/img/icon_mouse.png")));
        btnImagePenetration.setPadding(2);
        btnImagePenetration.setUnitedIconHeight(1.0f);
        btnImagePenetration.setUnitedIconWidth(1.2f);
        gbc = new GridBagConstraints();
        gbc.gridx = 1;
        gbc.gridy = 0;
        pImage.add(btnImagePenetration, gbc);
    }

    /**
     * @noinspection ALL
     */
    public JComponent $$$getRootComponent$$$() {
        return root;
    }

}
